//
//  NSArray+MHExtension.m
//  Pods
//
//  Created by SY on 2019/1/5.
//

#import "NSArray+MHExtension.h"

@implementation NSArray (MHExtension)
-(NSString *)getNetPamaes{
    if (!self.count) return @"[]";
    NSMutableString *str = @"".mutableCopy;
    for (int i = 0; i < self.count; i++) {
        if (i == self.count -1) {
            [str appendFormat:@"%@",self[i]];
        }else{
            [str appendFormat:@"%@,",self[i]];
        }
    }
    [str insertString:@"[" atIndex:0];
    [str insertString:@"]" atIndex:str.length];
    return str;
}
+(NSString *)getNetArr:(NSData *)jsonData{
    NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
    NSMutableString *mutStr = [NSMutableString stringWithString:jsonString];
    NSRange rang = {0,jsonString.length};
    [mutStr replaceOccurrencesOfString:@" " withString:@"" options:NSLiteralSearch range:rang];
    NSRange rang2 = {0,mutStr.length};
    [mutStr replaceOccurrencesOfString:@"\n" withString:@"" options:NSLiteralSearch range:rang2];
    NSRange rang3 = {0,mutStr.length};
    NSString *str = @"\\";
    [mutStr replaceOccurrencesOfString:str withString:@"" options:NSLiteralSearch range:rang3];
    return mutStr;
}
@end
